
function loginInput(form){
	var checktext = /^\s*$/;
	if(form.user_name.value==""||checktext.test(form.user_name.value)==true){
		$("#show_msg")[0].innerHTML="\u8bf7\u8f93\u5165\u7528\u6237\u540d";
		form.user_name.select();
		return(false);
	} if(form.password.value==""){
		$("#show_msg")[0].innerHTML="\u8bf7\u8f93\u5165\u5bc6\u7801";
		form.password.select();
		return(false);
	} if(form.captcha.value==""){
		$("#show_msg")[0].innerHTML="\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801";
		form.captcha.select();
		return(false);
	 }
		return(true);
}

function registerInput(form){

	var emailreg =/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/;
	var checktext = /^\s*$/;
	if(form.user_name.value==""||checktext.test(form.user_name.value)==true){
		$("#user_hint")[0].innerHTML="请输入用户名";
		form.user_name.select();
		return(false);
	}else if(form.password.value==""){
		$("#password_hint")[0].innerHTML="请设置密码";
		form.password.select();
		return(false);
	}else if(form.password.value.length<6){
		$("#password_hint")[0].innerHTML="密码不小于6位";
		form.password.select();
		return(false);
	}else if(form.password.value.length>30){
		$("#password_hint")[0].innerHTML="密码不超过30位";
		form.password.select();
		return(false);
	}else if(form.password_confirm.value==""){
		$("#password_confirm_hint")[0].innerHTML="请再次确认密码";
		form.password_confirm.select();
		return(false);
	}else if(form.password.value!=form.password_confirm.value){
		$("#password_confirm_hint")[0].innerHTML="您两次输入的密码不一致";
		form.password_confirm.select();
		return(false);
	}else if(form.email.value==""||checktext.test(form.email.value)==true){
		$("#email_hint")[0].innerHTML="请输入邮箱";
		form.email.select();
		return(false);
	}else if(form.email.value.length>60){
		$("#email_hint")[0].innerHTML="您输入的邮箱过长";
		form.email.select();
		return(false);
	}else if(!emailreg.test(form.email.value)){
		$("#email_hint")[0].innerHTML="请输入有效的邮箱";
		form.email.select();
		return(false);
	}else if(form.captcha.value==""){
		$("#captcha_hint")[0].innerHTML="请输入验证码";
		form.captcha.select();
		return(false);
	}else{
		if($("#user_hint")[0].innerHTML=="已经注册"||$("#email_hint")[0].innerHTML=="已经注册"){
			return(false);
		}else{
			return(true);
		}
		
	}

 }


function change_passwordInput(form){
	var checktext = /^\s*$/;
	/*if(form.password_former.value==""||checktext.test(form.password_former.value)==true){
		$("#password_former_hint")[0].innerHTML="请输入原密码";
		form.password_former.select();
		return(false);
	}*/
	if(form.password.value==""){
		$("#password_hint")[0].innerHTML="请设置密码";
		form.password.select();
		return(false);
	} if(form.password.value.length<6){
		$("#password_hint")[0].innerHTML="密码不小于6位";
		form.password.select();
		return(false);
	} if(form.password.value.length>30){
		$("#password_hint")[0].innerHTML="密码不超过30位";
		form.password.select();
		return(false);
	}
	if(form.password_confirm.value==""){
		$("#password_confirm_hint")[0].innerHTML="请再次确认密码";
		form.password_confirm.select();
		return(false);
	} if(form.password.value!=form.password_confirm.value){
		$("#password_confirm_hint")[0].innerHTML="您两次输入的密码不一致";
		form.password_confirm.select();
		return(false);
	}
	else if(form.captcha.value==""){
		$("#captcha_hint")[0].innerHTML="请输入验证码";
		form.captcha.select();
		return(false);
	 }
	else{
		return(true);
	}
}

function loginBindInput(form){
	var checktext = /^\s*$/;
	if(form.user_name.value==""||checktext.test(form.user_name.value)==true){
		$("#login_user_hint")[0].innerHTML="\u8bf7\u8f93\u5165\u7528\u6237\u540d";
		form.user_name.select();
		return(false);
	} if(form.password.value==""){
		$("#login_password_hint")[0].innerHTML="\u8bf7\u8f93\u5165\u5bc6\u7801";
		form.password.select();
		return(false);
	} else{
		return(true);
	}
}

function registerBindInput(form){

	var emailreg =/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/;
	var checktext = /^\s*$/;
	if(form.user_name.value==""||checktext.test(form.user_name.value)==true){
		$("#user_hint")[0].innerHTML="请输入用户名";
		form.user_name.select();
		return(false);
	}else if(form.password.value==""){
		$("#password_hint")[0].innerHTML="请设置密码";
		form.password.select();
		return(false);
	}else if(form.password.value.length<6){
		$("#password_hint")[0].innerHTML="密码不小于6位";
		form.password.select();
		return(false);
	}else if(form.password.value.length>30){
		$("#password_hint")[0].innerHTML="密码不超过30位";
		form.password.select();
		return(false);
	}else if(form.password_confirm.value==""){
		$("#password_confirm_hint")[0].innerHTML="请再次确认密码";
		form.password_confirm.select();
		return(false);
	}else if(form.password.value!=form.password_confirm.value){
		$("#password_confirm_hint")[0].innerHTML="您两次输入的密码不一致";
		form.password_confirm.select();
		return(false);
	}else if(form.email.value==""||checktext.test(form.email.value)==true){
		$("#email_hint")[0].innerHTML="请输入邮箱";
		form.email.select();
		return(false);
	}else if(form.email.value.length>60){
		$("#email_hint")[0].innerHTML="您输入的邮箱过长";
		form.email.select();
		return(false);
	}else if(!emailreg.test(form.email.value)){
		$("#email_hint")[0].innerHTML="请输入有效的邮箱";
		form.email.select();
		return(false);
	}else{
		if($("#user_hint")[0].innerHTML=="已经注册"||$("#email_hint")[0].innerHTML=="已经注册"){
			return(false);
		}else{
			return(true);
		}
		
	}

 }
